package example.oauth;

import java.util.HashMap;
import java.util.Map;

/**
 * 存储应用程序授权		Consumer-->消费方(需要用户提供授权的第三方平台)
 * @author tommy
 *
 */ 
public class OAuthConsumer {
	
    public final String callbackURL;
    public final String consumerKey;
    public final String consumerSecret;
    public final OAuthServiceProvider serviceProvider;
    
    /**
     * 
     * @param callbackURL	       认证成功后浏览器会被重定向到这个url中 
     * @param consumerKey      App Key(应用信息中的App Key值)
     * @param consumerSecret   App Secret(应用信息中的App Secret值)
     * @param serviceProvider  开放平台(服务提供商)
     */
	public OAuthConsumer(String callbackURL, String consumerKey,
			String consumerSecret, OAuthServiceProvider serviceProvider) {
		this.callbackURL = callbackURL;
		this.consumerKey = consumerKey;
		this.consumerSecret = consumerSecret;
		this.serviceProvider = serviceProvider;
	}
	
	private final Map<String,Object> properties = new HashMap<String,Object>();
	
	public void setProperty(String name,String value){
		properties.put(name, value);
	}
	public Object getProperty(String name){
		return properties.get(name);
	}
	
	public static final String ACCESSOR_SECRET = "oauth_accessor_secret";
    
}
